package com.aspose.cells;

import java.awt.Dimension;
import java.awt.Rectangle;

class zao {
   public static void a(zan var0, com.aspose.cells.b.a.d.zm var1, com.aspose.cells.a.d.ze var2, ImageOrPrintOptions var3) throws Exception {
      int var4 = (int)(var0.g * (double)var3.getHorizontalResolution() + 0.9990000128746033D) + 1;
      int var5 = (int)(var0.h * (double)var3.getVerticalResolution() + 0.9990000128746033D) + 1;
      Dimension var6 = new Dimension(1024, 768);
      Dimension var7 = new Dimension(271, 203);
      Rectangle var8 = new Rectangle(0, 0, var4, var5);
      com.aspose.cells.a.d.a.zj var9 = new com.aspose.cells.a.d.a.zj(var8, var6, var7, new com.aspose.cells.a.d.a.zk());
      var9.d(24);
      var9.a(1);
      var9.b(13);
      var9.e(1);
      var9.c(3);
      com.aspose.cells.a.d.a.zc var10 = var9.a();
      var10.setRenderingHints(var3.g);
      if (var0 == null) {
         throw new Exception("ArgumentNull node");
      } else {
         ((com.aspose.cells.a.d.zat)var2).b((com.aspose.cells.a.d.zl)var0, var10);
         var2.a();
         var9.a(var1.j());
         var1.b(0L);
      }
   }

   public static void a(com.aspose.cells.a.d.zl var0, com.aspose.cells.b.a.d.zm var1, ImageOrPrintOptions var2, int var3, int var4) throws Exception {
      Dimension var5 = new Dimension(1024, 768);
      Dimension var6 = new Dimension(271, 203);
      float var7 = (float)var5.width / ((float)var6.width / 25.4F);
      float var8 = (float)var5.height / ((float)var6.height / 25.4F);
      float var9 = var7 / (float)var2.getHorizontalResolution();
      float var10 = var8 / (float)var2.getVerticalResolution();
      var5.width = (int)((float)var5.width / var9 + 0.5F);
      var5.height = (int)((float)var5.height / var10 + 0.5F);
      float var11 = (float)var2.getHorizontalResolution() / com.aspose.cells.a.d.zfq.a();
      float var12 = (float)var2.getVerticalResolution() / com.aspose.cells.a.d.zfq.a();
      int var13 = (int)((float)var3 * var11 + 0.5F) - 1;
      int var14 = (int)((float)var4 * var12 + 0.5F) - 1;
      Rectangle var15 = new Rectangle(0, 0, var13, var14);
      com.aspose.cells.a.d.a.zj var16 = new com.aspose.cells.a.d.a.zj(var15, var5, var6, new com.aspose.cells.a.d.a.zk());
      var16.d(24);
      var16.a(1);
      var16.b(13);
      var16.e(1);
      var16.c(3);
      com.aspose.cells.a.d.a.zc var17 = var16.a();
      var17.setRenderingHints(var2.g);
      if (var0 == null) {
         throw new Exception("ArgumentNull node in saveApsToEmfStream ");
      } else {
         var17.scale((double)var11, (double)var12);
         com.aspose.cells.a.d.zat var18 = new com.aspose.cells.a.d.zat();
         var18.b((com.aspose.cells.a.d.zl)var0, var17);
         var18.a();
         var16.a(var1.j());
         var1.b(0L);
         var17.dispose();
      }
   }
}
